package com.mellarius.activities;

import com.mellarius.R;
import com.mellarius.fragments.FragmentRepository.MainApiariesFragment;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.PopupMenu;
import android.widget.Toast;
import android.widget.PopupMenu.OnMenuItemClickListener;


public class HiveOperation extends Activity implements
OnMenuItemClickListener   {
	final Context context = this;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_batch_operation);

	}
	public boolean onCreateOptionsMenu(Menu menu) {

		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {

		switch (item.getItemId()) {
		case R.id.action_Apiario:
		Toast.makeText(this, MainApiariesFragment.getApiary().getIdentificacao(), Toast.LENGTH_SHORT).show();
		break;
		default:
		break;
		}
		return super.onOptionsItemSelected(item);
	}



	/** instantiates the activity BatchOperation */
	public void openAlimentationDialog(View view) {
        PopupMenu popupMenu = new PopupMenu(HiveOperation.this, view);
        popupMenu.setOnMenuItemClickListener(HiveOperation.this);
        popupMenu.getMenu().add(2, 0, 1,R.string.batchOperation_colocarAlimentacao);
        popupMenu.show();

	}
	public void openTraramentoDialog(View view) {
        PopupMenu popupMenu = new PopupMenu(HiveOperation.this, view);
        popupMenu.setOnMenuItemClickListener(HiveOperation.this);
        popupMenu.getMenu().add(1, 0, 1,R.string.batchOperation_colocartratamento);
        popupMenu.getMenu().add(1, 1, 1,R.string.batchOperation_retirartratamento);
        popupMenu.show();

	}
	public void openColheitaDialog(View view) {
        PopupMenu popupMenu = new PopupMenu(HiveOperation.this, view);
        popupMenu.setOnMenuItemClickListener(HiveOperation.this);
        popupMenu.getMenu().add(0, 0, 1, R.string.batchOperation_registarColheita);
        popupMenu.getMenu().add(0, 1, 1,R.string.batchOperation_reporCeras);
        popupMenu.show();

	}

	@Override
	public boolean onMenuItemClick(MenuItem arg0) {
		// TODO Auto-generated method stub


		return false;
	}
	

	}
